#pragma once

#include "IMat.h"

class __declspec(dllexport) Mat : virtual public IMat {
public:
	Mat (void);
	Mat (const MatrixData& data);
	Mat (const IMat& src);

	virtual bool Load (const IReader* reader);
	virtual bool Save (const IWriter* writer);

	virtual bool SetROI (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2);
	virtual void ResetROI (void);

	virtual void SaveChanges (void);
	virtual void DiscardChanges (void);

	virtual MatrixRow GetRow (unsigned int rowNumber) const;
	virtual MatrixColumn GetColumn (unsigned int columnNumber) const;

	virtual unsigned int GetRowCount (void) const;
	virtual unsigned int GetColumnCount (void) const;
	virtual unsigned int GetRowSize (void) const;
	virtual unsigned int GetColumnSize (void) const;

	virtual bool matWaveletByRow (const std::vector <MatrixValue>& highFilter, const std::vector <MatrixValue>& lowFilter);
	virtual bool matWaveletByColumn (const std::vector <MatrixValue>& highFilter, const std::vector <MatrixValue>& lowFilter);
	virtual bool rowWavelet (const unsigned int& rowNumber, const std::vector <MatrixValue>& highFilter, const std::vector <MatrixValue>& lowFilter);
	virtual bool columnWavelet (const unsigned int& columnNumber, const std::vector <MatrixValue>& highFilter, const std::vector <MatrixValue>& lowFilter);
private:
	// Matrix data. (see definition MatrixDataType)
	MatrixData defaultData;
	MatrixData currentData;

	// Matrix default parameters:
	unsigned int defaultRowCount;
	unsigned int defaultColumnCount;
	unsigned int defaultRowSize;
	unsigned int defaultColumnSize;

	// Matrix current parameters:
	unsigned int currentRowCount;
	unsigned int currentColumnCount;
	unsigned int currentRowSize;
	unsigned int currentColumnSize;

	// Coordinates Range of Interest (ROI):
	// first point - 
	unsigned int ROIx1;
	unsigned int ROIy1;

	// second point -
	unsigned int ROIx2;
	unsigned int ROIy2;

	// trigger changes
	bool matrixChange;

	// Set current data in matrix
	void SetCurrentData (void);
	
	// Set default data in matrix
	void SetData (MatrixData data);
};